CUSTOM Windows API 1.14
Loading...
Searching...
No Matches
ccw_Error.h
Go to the documentation of this file.
1// File Revision
2// Rev 1.04
3//
4// Rev. notes:
5// - rel 1.00: first release
6// - rel 1.01: Added CcwResult_CodePageUnsupported
7// - rel 1.02: Added CcwResult_CommunicationPortBusy and CcwResult_FuncChannelClosed
8// - rel 1.03: Added CcwResult_CounterUnsupported
9// - rel 1.04: Added CcwResult_UnsupportedOperation
10// NOTE: Please DO NOT EDIT THIS FILE
11
16
17#ifndef _COMMON_CCW_ERROR_H__
18#define _COMMON_CCW_ERROR_H__
19
20
24typedef enum : DWORD
25{
28
31
34
37
40
43
46
49
52
55
58
61
64
67
70
73
76
79
82
85
88
91
94
97
100
101} CcwResult;
102
103
104
105
106// Hide in documentation
108
109typedef struct
110{
111 CcwResult ccwError;
112 const wchar_t* strDescription;
113} CcwErrorType;
114
115//Errors List Size
116#define ERROR_CCW_LISTSIZE (sizeof(ERROR_CCW_LIST)/sizeof(CcwErrorType))
117
118//Errors List description
119const CcwErrorType ERROR_CCW_LIST[] = {
120 // Error // Error Descrition
121 { CcwResult_OK, L"Ok" },
122 { CcwResult_OpenDeviceError, L"Open port or device Error" },
123 { CcwResult_UnsupportedFunction, L"Function not supported by this device" },
124 { CcwResult_InvalidParameter, L"Parameter value not valid" },
125 { CcwResult_SmallBuffer, L"Buffer small" },
126 { CcwResult_NullPointer, L"A parameter is NULL" },
127 { CcwResult_NotInitialized, L"Library not initialized" },
128 { CcwResult_InvalidDeviceID, L"Device ID not valid or unknown" },
129 { CcwResult_ReadError, L"Read data error" },
130 { CcwResult_WriteError, L"Write data error" },
131 { CcwResult_UnsupportedDevice, L"Device unknown or unsupported" },
132 { CcwResult_CommunicationError, L"Communication error" },
133 { CcwResult_BarcodeUnsupportedError, L"Barcode type unknown or unsupported" },
134 { CcwResult_BarcodeWidthError, L"Barcode width wrong or bigger than print width" },
135 { CcwResult_DeviceAlreadyOpenError, L"Device already open" },
136 { CcwResult_PrinterNotExistError, L"Printer not found" },
137 { CcwResult_UnknowPrinterError, L"Unknown Printer" },
138 { CcwResult_OpenFileError, L"File not found or open error" },
139 { CcwResult_CommunicationBusy, L"The communication with the device is busy" },
140 { CcwResult_CodePageUnsupported, L"The codepage selected is unsupported" },
141 { CcwResult_CommunicationPortBusy, L"The communication port selected is busy so it's used by another software" },
142 { CcwResult_FuncChannelClosed, L"This function needs to use a communication channel currently closed" },
143 { CcwResult_CounterUnsupported, L"The counter request is unsupported" },
144 { CcwResult_UnsupportedOperation, L"Operation not supported by this device or by this driver" },
145
146};
147
148
149// @endcond
150
151
159static const wchar_t* CcwResultToText(CcwResult result)
160{
161 DWORD i;
162
163 for (i = 0; i<ERROR_CCW_LISTSIZE; i++)
164 {
165 if (ERROR_CCW_LIST[i].ccwError == result)
166 return ERROR_CCW_LIST[i].strDescription;
167 }
168
169 return L"Unknown Error";
170}
171
172
173#endif
static const wchar_t * CcwResultToText(CcwResult result)
Definition ccw_Error.h:159
CcwResult
Definition ccw_Error.h:25
@ CcwResult_InvalidParameter
Invalid parameter.
Definition ccw_Error.h:36
@ CcwResult_OK
All OK.
Definition ccw_Error.h:27
@ CcwResult_NotInitialized
Library not initialized.
Definition ccw_Error.h:45
@ CcwResult_CodePageUnsupported
Code page unsupported.
Definition ccw_Error.h:84
@ CcwResult_PrinterNotExistError
Printer doesn't exist Error.
Definition ccw_Error.h:72
@ CcwResult_NullPointer
Null or invalid pointer.
Definition ccw_Error.h:42
@ CcwResult_UnsupportedDevice
Unsupported Device.
Definition ccw_Error.h:57
@ CcwResult_DeviceAlreadyOpenError
Open Port/Device Error.
Definition ccw_Error.h:69
@ CcwResult_OpenFileError
File not found or error during the open.
Definition ccw_Error.h:78
@ CcwResult_BarcodeWidthError
Barcode width Error.
Definition ccw_Error.h:66
@ CcwResult_CounterUnsupported
Counter unsupported.
Definition ccw_Error.h:93
@ CcwResult_UnsupportedFunction
Unsupported Function.
Definition ccw_Error.h:33
@ CcwResult_CommunicationPortBusy
Communication port busy.
Definition ccw_Error.h:87
@ CcwResult_UnsupportedOperation
Unsupported Operation.
Definition ccw_Error.h:96
@ CcwResult_ReadError
The device doesn't answer.
Definition ccw_Error.h:51
@ CcwResult_CommunicationBusy
Communication busy.
Definition ccw_Error.h:81
@ CcwResult_CommunicationError
Error communication data.
Definition ccw_Error.h:60
@ CcwResult_UnknowError
Unknow Error.
Definition ccw_Error.h:99
@ CcwResult_OpenDeviceError
Open Port/Device Error.
Definition ccw_Error.h:30
@ CcwResult_UnknowPrinterError
Printer unknow Error.
Definition ccw_Error.h:75
@ CcwResult_WriteError
Write error.
Definition ccw_Error.h:54
@ CcwResult_SmallBuffer
Small buffer.
Definition ccw_Error.h:39
@ CcwResult_BarcodeUnsupportedError
Barcode type unsupported.
Definition ccw_Error.h:63
@ CcwResult_InvalidDeviceID
Invalid device ID.
Definition ccw_Error.h:48
@ CcwResult_FuncChannelClosed
Communication channel closed.
Definition ccw_Error.h:90